<!--
 * @Description: 
 * @Version: 2.0
 * @Autor: wsh
 * @Date: 2023-06-20 10:13:27
 * @LastEditors: wsh
 * @LastEditTime: 2023-06-20 10:19:33
-->
<template>
  <BaseContainer>
    <aplid-base-crud ref="crud" class="w-100" v-bind="baseConfig">
      <template #evaluatorJson="{row}">
        <el-popover
          placement="top-start"
          title="下发对象"
          :width="200"
          trigger="hover"
          :content="row.evaluatorJson"
        >
          <template #reference>
            <el-text type="primary">详情</el-text>
          </template>
        </el-popover>
        
      </template>
      <template #DetailDialog="{row,show}">
        <Detail
        @refresh="handleRefresh" 
        :api="baseConfig.api" 
        :key="show" 
        formType="detail"
        :nowRowData="row"
        ></Detail>
      </template>
      <template #addDialog="{row,show}">
        <AddEdit
        @refresh="handleRefresh" 
        :api="baseConfig.api" 
        :key="show" 
        formType="add"
        :nowRowData="row"
        ></AddEdit>
      </template>
      <template #editDialog="{row,show}">
        <AddEdit
        @refresh="handleRefresh" 
        :api="baseConfig.api" 
        :key="show" 
        formType="edit"
        :nowRowData="row"></AddEdit>
      </template>
    </aplid-base-crud>
   
  </BaseContainer>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { baseConfig } from './config'
import AddEdit from './AddEdit/index.vue'
import Detail from './Detail/index.vue'

const crud = ref()
//  处理刷新
const handleRefresh = (query) => {
  nextTick(() => {
    crud.value.refreshChange(query)
  })
}


</script>

<style scoped></style>